package com.demo.web.modules.cin;

import com.demo.common.constant.api.ScaCatalogAPIConstant;
import com.demo.common.result.ResponseInfo;
import com.demo.common.result.ResultVo;
import com.demo.service.cin.CinCatalogService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("/cin/catalog")
public class CinCatalogController {
    @Autowired
    private CinCatalogService cataService;

    @GetMapping("/test")
    public String test(){
        return "hello, you are in ScaCatalog test!";
    }

    //查询项目列表
    @RequestMapping(value = ScaCatalogAPIConstant.PROJECT_LIST_API, method = RequestMethod.POST)
    public ResultVo getProjectCatalogList() {
        return ResponseInfo.<Object>success(cataService.getProjectCatalogList());
    }

    //查询页面列表
    @RequestMapping(value = ScaCatalogAPIConstant.PAGE_LIST_API, method = RequestMethod.POST)
    public ResultVo getPageCatalogList() {
        return ResponseInfo.<Object>success(cataService.getPageCatalogList());
    }

}
